-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add quoted let #7388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add quoted let #7388
Conversation
d37b153
to
13bc498
Compare
7062da5
to
e0c312b
Compare
ref.elem = ret + 1 | ||
ret | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe reuse FreshNameCreator from the compiler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would have a global indexing which would make any debugging harder as it would keep undesired state from one macro expansion to the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a macro contains many usage of let
, then it faces the same problem.
FreshNameCreator
is better in the sense that it keeps different counters for different names, instead of using one global counter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it uses a global counter across all files in the compilation run and each macro expansion site which is what we are trying to avoid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible to call def setFreshNames(freshNames: FreshNameCreator)
on Context
before macro expansion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a could try to create a fresh FreshNameCreator
for each macro expansion site.
No description provided.